//
//  GOUtility.h
//  GO2O
//
//  Created by yemeihua on 15/12/29.
//  Copyright © 2015年 yemeihua. All rights reserved.
//

#import <Foundation/Foundation.h>

CGFloat GOScreenScale();

static inline CGFloat CGFloatToPixel(CGFloat value) {
    return value * GOScreenScale();
}

/// Convert pixel to point.
static inline CGFloat CGFloatFromPixel(CGFloat value) {
    return value / GOScreenScale();
}

void GOCGContextAddRoundedRect(CGContextRef c, CGRect rect, CGFloat radius);

CGRect GOFixCGRect(CGRect rect);

CGPoint GOFixCGPoint(CGPoint point);

@interface GOUtility : NSObject

+ (NSURL *)convert2Mp4:(NSURL *)movUrl;

//create Label
+(UILabel *)creatLabel:(CGRect)frame textcolor:(UIColor*)color text:(NSString *)str fontsize:(CGFloat)size;

//create UIImageView
+(UIImageView *)creatImgView:(CGRect)frame imageName:(NSString *)imgName;

//create UIButton
+(UIButton *)createButton:(CGRect)frame title:(NSString *)title image:(NSString *)imageStr target:(id)target selector:(SEL)selector;

/// 压缩数据
+ (NSData *)compressData:(NSData *)uncompressedData;
/// 解压缩zip数据
+ (NSData *)uncompressZippedData:(NSData *)compressedData;

@end
